I want to disable copying picture files from an HTML file. I have purchased "Activ eBook Compiler" software which disables left-click copying, printing, and Alt+PrtScr copying to clipboard but it still doesn't disable drag & drop. I realise that a knowledgeable computer user would be able to get around most attempts to disable copying but I want to, at least, make it difficult. I have tried:
[HTML]<BODY onBeginDrag="return FALSE ;"> [/HTML]
and:
[HTML]<img src=”mypic.jpg” ondrag=”return false;” />[/HTML]
but neither command has any effect in my browser (IE7) in XP Pro.
Can anyone help please?
18 36650
Moving to JavaScript Forum.
--Kevin
There's no cross-browser ondrag event. Drag/drop depends on the onmousemove/up/down events.
There is nothing that can prevent your images from being copied.
But yeah, for disabling the drag thing, use onmousedown = "return false;" in the body tag.
But this will ruin your inputs and textareas, as this will not let the user to move focus to them with mouse click.
So if there's any input or textarea in your page, there's another way out (a bit lengthy, so will tell you only if you need).
For disabling right click, use oncontextmenu = "return false;" in body tag. But this is not compatible attribute with the standard modes. So rather do it with JavaScript.
Maybe you can find some help here: DELETED
What does that have to do with the original question?
Respected Sir,
I am not sure that whether I am giving the correct answer but somehow this will help you to prevent your picture copied. - <html>
-
<head>
-
<script langauge="javascript">
-
function onDrag()
-
{
-
alert("selected");
-
}
-
</script>
-
</head>
-
<body>
-
<div id="myDic" onmousedown="onDrag()">
-
<br/>
-
<img src="1.jpg" >
-
<br/>
-
</div>
-
<br/>
-
</body>
-
</html>
Just try this one.
Regards
Ramanan Kalirajan
Isn't onmousedown = "return false;" a better option?
To protect images, watermark them. As soon as you display them on your page and someone visits it, it's been downloaded, so any script won't protect an image.
When I was in college, an assoicate of mine was working on something sneaky.
He had an html page (on his server) with images. And a challenge to try and get a copy of them without using the printscreen(screen capture) button.
If you higlighted the image, it changed.
If you right-clicked and said save image, it was a different image.
if you went to the URL of the image, it was a different image.
I don't know how he did it, but he was sneaky like that.
To protect images, watermark them. As soon as you display them on your page and someone visits it, it's been downloaded, so any script won't protect an image.
Moreover there's a "Prt Scr" key.
Moreover there's a "Prt Scr" key.
True, though the OP said this key was disabled. One simple way to protect the content would be to create a transparent div over the content. No matter where the user clicks, they can't get at the content. The only way they can get the image is by viewing the source and finding the image source, or modifying the source to remove the div.
When I was in college, an assoicate of mine was working on something sneaky.
He had an html page (on his server) with images. And a challenge to try and get a copy of them without using the printscreen(screen capture) button.
If you higlighted the image, it changed.
If you right-clicked and said save image, it was a different image.
if you went to the URL of the image, it was a different image.
I don't know how he did it, but he was sneaky like that.
Could you not check the source or disable scripting?
Respected Sir,
I am not sure that whether I am giving the correct answer but somehow this will help you to prevent your picture copied. - <html>
-
<head>
-
<script langauge="javascript">
-
function onDrag()
-
{
-
alert("selected");
-
}
-
</script>
-
</head>
-
<body>
-
<div id="myDic" onmousedown="onDrag()">
-
<br/>
-
<img src="1.jpg" >
-
<br/>
-
</div>
-
<br/>
-
</body>
-
</html>
Just try this one.
Regards
Ramanan Kalirajan
Thank you for the solution to my problem. This routine, combined with the eBook Compiler software, disables all copying after the files are compiled. Your help is very much appreciated ..... mclerp
There is nothing that can prevent your images from being copied.
But yeah, for disabling the drag thing, use onmousedown = "return false;" in the body tag.
But this will ruin your inputs and textareas, as this will not let the user to move focus to them with mouse click.
So if there's any input or textarea in your page, there's another way out (a bit lengthy, so will tell you only if you need).
For disabling right click, use oncontextmenu = "return false;" in body tag. But this is not compatible attribute with the standard modes. So rather do it with JavaScript.
Thank you for your help. I haven't been able to get this to work but that's probably because I don't know how to write the full code. As a Newbie, I am VERY new and haven't written any Java script before. However, the routine described by RamananKalirajan works well. Thanks to everyone who has replied to my question ..... mclerp
Just a couple of notes:
1. The script language attribute is deprecated, so use type instead: - <script type="text/javascript">
2. Unless you want to display a message, return false as hsriat pointed out is better: - <div id="myDiv" onmousedown="return false;">
Thank you for your help. I haven't been able to get this to work but that's probably because I don't know how to write the full code. As a Newbie, I am VERY new and haven't written any Java script before. However, the routine described by RamananKalirajan works well. Thanks to everyone who has replied to my question ..... mclerp
Hi RamananKalirajan,
I tried using that code you wrote for the "image disable". You'd had said there is a way to get around the text issue so folks can type in input boxes while not being able to drag images.
Can you explain how to do this?
Thanks in advance
two tricks that work even if javascript is disabled:
1. change the images to relative positioned divs, height and width specified. then set the background-image to the .src of the img tag the div replaces.
2. place a relative positioned, background-color: transparent, height and width specified, border: 0px text input in front of the image. this clear input intercepts clicks even without javascript, giving you the crappy input-related menu options like paste, select All, and copy.
It seems that there is no multi-browser script that keeps users from downloading/dragging images to their computer desktop.
or is there?
Sign in to post your reply or Sign up for a free account.
Similar topics
by: SamSpade |
last post by:
There seems to be two ways to put things on the clipboard ( I don't mean
different formats): SetClipboardData and OleSetClipboard
If I want to get data off the clipboard do I care how it was put...
|
by: zav |
last post by:
Hi all i`m having a small problem with windows forms, i`m attempting to
provide the following functionality to a form.
Ability to drag and drop another form onto a form and then to dock this...
|
by: Qingdong Z. |
last post by:
I have a VS.NET windows application which use drag-drop feather. It works
fine when application start, but stops working after application run one or
two days. The application is related to Video...
|
by: Pesso |
last post by:
I'm loading a text file to a RichTextBox control to drag a selection of a
text and drop it into a tree view control. It works except after the drag
and drop operation the RichTextBox scrolls to the...
|
by: timnels |
last post by:
I have created a muti-select treeview control. Problem is I am now
trying to implement drag/drop in the application that uses it. It
seems the mouse down and mouse move events fire before the...
|
by: surf_doggie |
last post by:
Im not sure if this is the group to post in, if anyone knows a more
appropriate one please let me know.
Please consider the following example of a feature most all browsers
have that I would...
|
by: gilan |
last post by:
I'm building a javascript WYSIWYG editor using designMode. My main problem right now is that I'm trying to create dragging functions for certain classes of divs, but Firefox's own designMode...
|
by: Jeff |
last post by:
Hello,
I am trying to drag and drop a label control from one cell in a
tablelayoutpanel to another (VB2005). There is no problem if both
cells are visible, but i cannot get the tablelayoutpanel...
|
by: bob |
last post by:
Hi all,
I have a treeview that has drag drop.
Works well enough but...
If you drag out of bounds of the treeview the nodrop icon comes on.
Fair enough.
But when I move back inside the treeview...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |